package org.mm.proxycache;

import org.mm.proxycache.cache.db.DataManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.inject.Inject;
import com.google.inject.Singleton;

@Singleton
public class ShutdownHandler extends Thread
{
    
    @Inject
    private DataManager dataManager;
    
    @Override
    public void run()
    {
        // TODO: Perform graceful shutdown
        dataManager.close();
        
        log.info( "Shutdown" );
    }
    
    private Logger log = LoggerFactory.getLogger( ShutdownHandler.class );
}
